package creational.singleton;

import java.util.HashMap;
import java.util.Map;

public class ConfigManager {
  private static ConfigManager instance;

  private final Map<String, Object> configs = new HashMap<>();

  private ConfigManager() {
  }

  public static ConfigManager getInstance() {
    if (instance == null) {
      instance = new ConfigManager();
    }
    return instance;
  }

  public void set(String key, Object value) {
    configs.put(key, value);
  }

  public Object get(String key) {
    return configs.get(key);
  }
}
